﻿using System.Web.Http;
using Castle.MicroKernel.Registration;
using Castle.MicroKernel.SubSystems.Configuration;
using Castle.Windsor;

namespace Hiver.WebApi.Installers
{
    /// <summary>
    /// 控制器注册
    /// </summary>
    public class ControllersInstaller : IWindsorInstaller
    {
        /// <summary>
        /// 控制器注册
        /// </summary>
        /// <param name="container"></param>
        /// <param name="store"></param>
        public void Install(IWindsorContainer container, IConfigurationStore store)
        {
            container.Register(Classes.FromThisAssembly()
                .BasedOn<ApiController>()
                .LifestyleTransient());
        }
    }
}